package com.example.searchcenter.center;



import com.example.searchcenter.R;
import com.example.searchcenter.helper.ImageLoader;

import android.os.Bundle;
import android.support.v4.app.Fragment;
import android.util.Log;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ImageView;
import android.widget.TextView;

/***
 * 
 * @author NguyenTrung
 *
 */
public class IntroduceFragment extends Fragment{
	public String idCenter = "";
	TextView Name;
	TextView des;
	TextView presenter;
	TextView phone;
	TextView address;
	TextView web;
	TextView createDate;
	ImageView thumbnail;
	public ImageLoader imageLoader;
	View rootView;
	
	public Log log;
	public IntroduceFragment() {
	}
	@Override
	public View onCreateView(LayoutInflater inflater, ViewGroup container,
			Bundle savedInstanceState) {
		rootView = inflater.inflate(R.layout.fragment_intro, container,
				false);
		imageLoader = new ImageLoader(getActivity());
		Name = (TextView) rootView.findViewById(R.id.name);
		thumbnail = (ImageView) rootView.findViewById(R.id.image);
		des = (TextView) rootView.findViewById(R.id.des);
		presenter = (TextView) rootView.findViewById(R.id.presenter);
		phone = (TextView) rootView.findViewById(R.id.phone);
		web = (TextView) rootView.findViewById(R.id.web);
		createDate = (TextView) rootView.findViewById(R.id.createDate);
		address = (TextView) rootView.findViewById(R.id.address);
		Log.w("image",DetailsCenter.thumbnaiImage );
		
		
		// display center data in textview
		Name.setText(DetailsCenter.name_center);
		imageLoader.DisplayImage(DetailsCenter.thumbnaiImage, thumbnail);
		des.setText(DetailsCenter.description);
		presenter.setText(DetailsCenter.presenter);
		phone.setText(DetailsCenter.phone);
		web.setText(DetailsCenter.website);
		createDate.setText(DetailsCenter.create_date);
		String addr = "Số:" + DetailsCenter.no + " ,đường " + DetailsCenter.street + " ,phường " + DetailsCenter.ward 
				+ " ,quận " + DetailsCenter.district + " ,thành phố " + DetailsCenter.city;
		address.setText(addr);
		
		return rootView;
		
	}
}
